tv_filter Function

public pure function tv_filter(x, lambda, niter) result(rst)

Applies a total-variation filter to a signal.

The algorithm used by this routine is based upon the algorithm presented by [Selesnick and Bayram] (https://eeweb.engineering.nyu.edu/iselesni/lecture_notes/TV_filtering.pdf).

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: x(:)

An N-element array containing the signal to filter.

real(kind=real64), intent(in) :: lambda

The regularization parameter. The actual value to use is problem dependent, but the noisier the data, the larger this value should be. A good starting point is typically 0.3 - 0.5; however, the actual value is problem dependent.

integer(kind=int32), intent(in), optional :: niter

An optional parameter controlling the number of iterations performed. The default limit is 10 iterations.

Return Value real(kind=real64), allocatable, (:)

An N-element array containing the filtered signal.